package com.util.cdb.service.impl;

import com.util.cdb.bean.entity.User;
import com.util.cdb.bean.vo.UserVO;
import com.util.cdb.dao.UserRepository;
import com.util.cdb.service.UserService;
import com.util.cdb.util.UUIDTool;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description: 查询用户信息实现类
 * @author: fengfazheng
 * @create: 2021-12-26 18:19
 **/
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    /**
     * 新增用户
     *
     * @param userVO
     */
    @Override
    public void createUser(UserVO userVO) {
        User user = new User();
        BeanUtils.copyProperties(userVO, user);
        user.setId(UUIDTool.getUUID());
        userRepository.save(user);
    }
}
